<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">分组页面管理</ui:define>
    <ui:define name="content">
        <h:form>
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton icon="fa fa-plus" value="新增"
                                         action="#{loanApplicationExportGroupPageListBean.onAdd}"
                                         rendered="#{loanApplicationExportGroupPageListBean.isNormal()}">
                            <f:setPropertyActionListener value="/views/application/page/list.xhtml"
                                                         target="#{currentUserBean.back}"/>
                        </p:commandButton>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card">
                            <p:dataTable id="loanBannerPageListDataTable"
                                         style="width: 100%"
                                         var="loanBannerPage"
                                         value="#{loanApplicationExportGroupPageListBean.bannerPageList}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         reflow="true"
                                         selection="#{loanApplicationExportGroupPageListBean.selectedRecords}"
                                         resizableColumns="true">

                                <p:column headerText="操作" style="width: 70px;text-align:center;"
                                          rendered="#{loanApplicationExportGroupPageListBean.isNotBatch()}">
                                    <p:splitButton icon="fa fa-eye"
                                                   action="#{loanApplicationExportGroupPageListBean.onEdit(loanBannerPage.id)}"
                                                   process="@this">
                                        <p:menuitem value="删除" icon="fa fa-fw fa-remove"
                                                    actionListener="#{loanApplicationExportGroupPageListBean.onDelete(loanBannerPage.id)}"
                                                    process="@this" update="loanBannerPageListDataTable">
                                            <p:confirm header="删除" message="确定删除该作用页面信息吗？"/>
                                        </p:menuitem>
                                        <f:setPropertyActionListener
                                                value="/views/application/page/list.xhtml"
                                                target="#{currentUserBean.back}"/>
                                    </p:splitButton>
                                </p:column>
                                <p:column headerText="作用页面名称" style="text-align:center">
                                    <h:outputText value="#{loanBannerPage.name}"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
